!
! test qmed
!
! $Id$

program testqmed

  use qmedian

  implicit none

  integer, parameter :: nele = 1000000
  real, dimension(nele) :: big, buf
  real :: median
  integer :: i, start, stop


  do i = 1, size(big)
     call random_number(big(i))
  enddo
  buf = big

  call system_clock(start)
  write(*,*) "select:"
  median =  select(buf,nele/2+1)
  call system_clock(stop)
  write(*,*) median, stop - start

  call system_clock(start)
  write(*,*) "qmedian:"
  call qmed(nele,big,nele/2+1,median)
  call system_clock(stop)
  write(*,*) median, stop - start

end program testqmed

